<%--
  User: yang
  Date: 8/24/20
  Time: 09:14
  Description: TODO 
--%>
<%@page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- 导入核心标签库 --%>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>显示学生座位</title>
    <%--  新 Bootstrap 核心 CSS 文件 --%>
    <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <script src="http://libs.baidu.com/jquery/1.7.0/jquery.min.js"></script>
    <%--  导入 jQuery   --%>
    <%--  最新的 Bootstrap 核心 JavaScript 文件   --%>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css">
    <script>
    </script>
</head>
<body>

<c:choose>
    <c:when test="${empty studentList}">
        <jsp:forward page="/student/getAll.action"/>
    </c:when>
    <c:otherwise>


        <table>
            <tr>
                <th colspan="8">教室入口</th>
            </tr>
            <c:forEach begin="1" end="8" var="hang">
                <tr>
                    <c:forEach begin="1" end="8" var="lie">
                        <td>
                            <c:forEach items="${studentList}" var="stu">
                                <c:if test="${stu.sx== hang and stu.sy==lie}">
                                    ${stu.sname}
                                </c:if>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
            </c:forEach>
        </table>


    </c:otherwise>
</c:choose>

<%--<h1>--%>
<%--    <a href="${pageContext.request.contextPath}/show_exam.jsp">展示考试成绩</a>--%>
<%--</h1>--%>

<h2> 读取 names.txt 文件</h2>
<form action="${pageContext.request.contextPath}/student/upload.action" method="post" enctype="multipart/form-data">
    文件 <input type="file" name="names"> <br>
    <input type="reset" value="重填"> &nbsp; <input type="submit" value="提交">
</form>


<h1>
    <a href="${pageContext.request.contextPath}/student_login.jsp">
        去登陆
    </a>
</h1>





</body>
</html>
